<%--
  Created by IntelliJ IDEA.
  User: zhongge
  Date: 2025/8/16
  Time: 1:52
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>添加结果</title>
    <style>
        .container {
            max-width: 600px;
            margin: 50px auto;
            padding: 30px;
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
            text-align: center;
        }
        .success-icon, .error-icon {
            font-size: 50px;
            margin-bottom: 20px;
        }
        .success-icon {
            color: #4CAF50;
        }
        .error-icon {
            color: #f44336;
        }
        h1 {
            margin-bottom: 20px;
            color: #333;
        }
        .message {
            font-size: 18px;
            margin-bottom: 30px;
            line-height: 1.6;
        }
        .btn {
            display: inline-block;
            padding: 10px 20px;
            background-color: #2196F3;
            color: white;
            text-decoration: none;
            border-radius: 4px;
            font-size: 16px;
            transition: background-color 0.3s;
        }
        .btn:hover {
            background-color: #0b7dda;
        }
        .actions {
            margin-top: 20px;
        }
    </style>
</head>
<body>
<div class="container">
    <c:choose>
        <c:when test="${not empty successMessage}">
            <div class="success-icon">✓</div>
            <h1>添加成功</h1>
            <div class="message">
                <p>${successMessage}</p>
            </div>
        </c:when>
        <c:otherwise>
            <div class="error-icon">✗</div>
            <h1>添加失败</h1>
            <div class="message">
                <p>${errorMessage != null ? errorMessage : '抱歉，添加学生信息时发生错误'}</p>
            </div>
        </c:otherwise>
    </c:choose>

    <div class="actions">
        <a href="${pageContext.request.contextPath}/list" class="btn">返回学生列表</a>
        <a href="student/add.jsp" class="btn" style="margin-left: 10px; background-color: #4CAF50;">继续添加</a>
    </div>
</div>
</body>
</html>
